import React, { Component } from 'react'

export default class Radio extends Component {
	
	state={
		Value: '男'
	}

	handleRadio=(e)=>{
		// console.log(e.target.value)
		this.setState( { Value: e.target.value} )
	}

  render() {

	  const { RadioGroup } = this.props

    return (
      <div>
			{
			  RadioGroup.map((obj,index)=>(
				<label className="radio-inline" key={index}>
				  <input type="radio" name='xingbie' 
				  value={obj.value} 
				  onChange={this.handleRadio}
				  checked={this.state.Value === obj.value}
				  />{obj.label}
				</label>
			  ))	
			}
      </div>
    )
  }
}
